#ifndef ______WARD___CHECKBOCK_H
#define ______WARD___CHECKBOCK_H


#include "uielement.h"
#include "driver.h"

#define CHECKBOX_CROSSLINES 0
#define CHECKBOX_MINIBOX 1
#define CHECKBOX_CHECK 2

class checkBox : public uielement
{

public:

	checkBox(int x = 0, int y = 0,  int w = 16, int s = CHECKBOX_CROSSLINES);

	void select() { data = !data; }
	void left() {}
	void right() {}

	void draw() { drawEnabled(xpos, ypos); }
	void drawAt(int x, int y) { drawEnabled(x, y); }
	bool clicked(int x, int y) { return (((x>=xpos)&&(x<=(xpos+width)))&&((y>=ypos)&&(y<=(ypos+width)))); }
	bool hover(int x, int y) {return (((x>=xpos)&&(x<=(xpos+width)))&&((y>=ypos)&&(y<=(ypos+width)))); }


	void onClick() { select(); }
	void setHover(bool h) { hovering = h; }

	float getData()  { return data; }
	void setData(float f) { data = f; }
	void setStyle(int s) {style = s;}

private:
	
	bool hovering;

	void drawEnabled(int x, int y);
	void drawStyle();
	void drawDisabled();
	int border, width;
	int style;

};




#endif